home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copywrite © 1992-1993 David S. Blumenthal *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define BoxSize 20
- #define StripSize 40
- #define CorrectTime 1
-
- void SlideWipe(GrafPtr);
-
- void SlideWipe(GrafPtr myGrafPtr)
- {
- int x, y;
- Rect theRect, dest;
- Rect scrollsource, scrolldest;
- int direction;
-
- direction = 0;
-
- for(y = 0; y < MAIN_WINDOW_HEIGHT; y += StripSize)
- {
- scrollsource = gMainWindow->portRect;
- scrollsource.top = scrollsource.top + y;
- scrollsource.bottom = scrollsource.top + StripSize;
-
- scrolldest = scrollsource;
-
- dest = gMainWindow->portRect;
- dest.top = dest.top + y;
- dest.bottom = dest.top + StripSize;
-
- theRect.top = y;
- theRect.bottom = y + StripSize;
-
- if(direction == 0)
- {
- OffsetRect(&scrolldest, BoxSize, 0);
-
- dest.right = dest.left + BoxSize;
-
- theRect.left = MAIN_WINDOW_WIDTH - BoxSize;
- theRect.right = MAIN_WINDOW_WIDTH;
-
- for(x = MAIN_WINDOW_WIDTH - BoxSize; x >= 0; x -= BoxSize)
- {
- StartTiming();
- theRect.left = x;
- CopyBits(&(gMainWindow->portBits), &(gMainWindow->portBits),
- &scrollsource, &scrolldest, 0, 0L);
- CopyBits(&(myGrafPtr->portBits), &(gMainWindow->portBits),
- &theRect, &dest, 0, 0L);
- theRect.right = x;
- TimeCorrection(CorrectTime);
- }
- }
- else
- {
- OffsetRect(&scrolldest, -BoxSize, 0);
-
- dest.left = dest.right - BoxSize;
-
- theRect.left = 0;
- theRect.right = BoxSize;
-
- for(x = BoxSize; x <= MAIN_WINDOW_WIDTH; x += BoxSize)
- {
- StartTiming();
- theRect.right = x;
- CopyBits(&(gMainWindow->portBits), &(gMainWindow->portBits),
- &scrollsource, &scrolldest, 0, 0L);
- CopyBits(&(myGrafPtr->portBits), &(gMainWindow->portBits),
- &theRect, &dest, 0, 0L);
- theRect.left = x;
- TimeCorrection(CorrectTime);
- }
- }
-
- direction = 1 - direction;
- }
- }